<template>
  <div>
    <!-- 一级路由占位符 -->
    <router-view></router-view>
  </div>
</template>

<script>
import { getAllChannelsAPI } from './api'
// try+catch 来捕获await 同步代码的错误
export default {
  async created () {
    try {
      const res = await getAllChannelsAPI()
      console.log(res)
    } catch (err) {
      // err参数拿到的就是错误对象
      console.dir(err)
    }
  }
}
</script>
<style scoped lang="less">

</style>
